-
Notifications
You must be signed in to change notification settings - Fork 478
[expo-cli] add --config flag to credentials:manager #2641
[expo-cli] add --config flag to credentials:manager #2641
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me.
Regarding the use case:
IIUC the user has separate configs (ie) app-1.json
and app-2.json
in the same project directory and they want to specify which one to use. Is this because people have published two separate expo apps within the same project directory?
@@ -20,8 +25,23 @@ export default function (program: CommanderStatic) { | |||
.description('Manage your credentials') | |||
.helpGroup('credentials') | |||
.option('-p --platform <platform>', 'Platform: [android|ios]', /^(android|ios)$/i) | |||
.option('--config [file]', 'Specify a path to app.json or app.config.js') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should move the exp.ts
logic into a method and attempt to reuse it since this is a lot of stylistic logic. Perhaps we could add a way to skip project validation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, skip flag would be probably best solution.
I decided to go this way because it's a bit isolated use cases and we will probably remove that command when web gui will be ready, so i didn't want modify code that handles other command. I don't have strong opinion on that either way.
if (!(await fs.pathExists(configPath))) { | ||
throw new Error(`File ${configPath} does not exist`); | ||
} | ||
ConfigUtils.setCustomConfigPath(projectDir, configPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iirc this particular method is somewhat fragile and shouldn't be used in more than one place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
♻️ reuse existing
Replaced |
9f0cab1
to
2e59040
Compare
Why
Support credentials manager for people that have multiple projects on a single codebase. For those cases, all credentials management had to be done via build command.
How
Support config flag. I couldn't use logic from
exp.ts
because that code requires a valid project and in the case ofcredentials:manager
command it's optional